﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Axe.Data.Mapping;

namespace Axe.Web.Controls
{
    public sealed class ClauseOpList : EnumBoundDropDownList<ConditionOperator>
    {
        protected override string GetEnumItemPublicName(ConditionOperator item)
        {
            switch (item)
            {
                case ConditionOperator.Equals:
                    return Resources.ClauseOperator.ClauseOperator_Equals;

                case ConditionOperator.NotEquals:
                    return Resources.ClauseOperator.ClauseOperator_NotEquals;

                case ConditionOperator.Like:
                    return Resources.ClauseOperator.ClauseOperator_Like;
                case ConditionOperator.Less:
                    return Resources.ClauseOperator.ClauseOperator_Less;
                case ConditionOperator.LessOrEq:
                    return Resources.ClauseOperator.ClauseOperator_LessOrEq;
                case ConditionOperator.Greater:
                    return Resources.ClauseOperator.ClauseOperator_Greater;
                case ConditionOperator.GreaterOrEq:
                    return Resources.ClauseOperator.ClauseOperator_GreaterOrEq;
                    
                default:
                    throw new InvalidOperationException("Unknown clause +" + item.ToString());
            }
        }
    }
}
